<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script src='js/jquery-1.8.3.js'></script>
	</head>

	<body>
		<div>
			<div class='am-g'>
				<div styel="width:100px; height:100px;display:flex">
					<img id="img" style="flex:1;width:100px; height:100px;"/>
				</div>
				<div>
					<input type="file" name="imgUpload" id="imgUpload">
				</div>
			</div>
		</div>
		<script>
			$("#imgUpload").change(function(e) {
				for(var i = 0; i < e.target.files.length; i++) {
					var file = e.target.files.item(i);
					var freader = new FileReader();
					freader.readAsDataURL(file);
					freader.onload = function(e) {
						var src = e.target.result;
						$("#uploadhead").attr("src", src);
						$("#img").attr("src", src);
					}
				}
			});
		</script>
	</body>

</html>